import { Module } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { BossModule } from './boss/boss.module';
import { TypeOrmModule } from '@nestjs/typeorm';
import { PlayWithModule } from './play-with/play-with.module';
import { OrderModule } from './order/order.module';
import { SettleModule } from './settle/settle.module';
import path from 'path'
console.log(process.cwd())
@Module({
  imports: [BossModule,
    TypeOrmModule.forRoot({
      type: "sqlite",
      database: process.cwd()+ "/testDB.db",//数据库地址不对 会自动生成数据库
      synchronize: true,
      logging: true,
      autoLoadEntities: true,//比如配置自动注册才能引入实体
      keepConnectionAlive: true,
      entities: [__dirname + "/**/entities/*.entity{.ts,.js}"],
    }),
    PlayWithModule,
    OrderModule,
    SettleModule
  ],
  controllers: [AppController],
  providers: [AppService],
})
export class AppModule { }
